<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript" >  
        // const xhr = new XMLHttpRequest()
        // xhr.responseType = "json";
        // xhr.open("get","https://i.maoyan.com/api/mmdb/movie/v3/list/hot.json?ct=%E5%8C%97%E4%BA%AC&ci=1&channelId=4")
        // xhr.open("get","http://127.0.0.1:8089/maoyan")
        // xhr.send();
        // xhr.onload = function(){
        //     console.log(xhr.response);
        // }


        // console.log(window.fetch);
        // 返回的是一个promise实例
        const p = fetch("http://127.0.0.1:8089/maoyan");
        console.log(p);
        p.then(res => {
            // console.log(res);
            // console.log(res.text());
            console.log(res.json());
            res.json().then(value=>{
                console.log(value);
            })
        })
        console.log(p);

        // const p = new Promise(resolve=>{
        //     resolve(100);
        // })

        // const p2 = p.then(function(){},function(){})

        // console.log(p2);


        // axios.interceptors.request.use(config=>{
        //     return config;
        // })

        // axios.interceptors.response.use(res=>{
        //     return res.data;
        // })

        // axios.get().then(value=>{})

    </script>
</body>
</html>